<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use \Illuminate\Routing\Router;
use App\Http\Controllers\Api\Web\Student\StudentController;
use App\Http\Controllers\Api\Web\Index\IndexController;
use App\Http\Controllers\Api\Web\Article\ArticleController;
use App\Http\Controllers\Api\Web\Teacher\TeacherController;
use App\Http\Controllers\Api\Web\School\SchoolController;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

/*Route::group(['prefix'=>''],function (Router $router){

});*/

Route::group(['prefix'=>'web'],function (Router $router){

    $router->group(['prefix'=>'article'],function () use ($router){
       $router->get('/lst',[ArticleController::class,'lst']);
       $router->get('/detail',[ArticleController::class,'detail']);
       $router->get('/getHot',[ArticleController::class,'getHot']);
    });
    $router->group(['prefix'=>'index'],function () use ($router){
       $router->get('/',[IndexController::class,'index']);
       $router->get('/ask',[IndexController::class,'ask']);
       $router->any('/upload',[IndexController::class,'upload']);
       $router->get('/guanggao',[IndexController::class,'advert']);
       $router->get('/siteInfo',[IndexController::class,'siteInfo']);
    });


    $router->group(['prefix'=>'student'],function () use ($router){
       $router->get('/applyShow',[StudentController::class,'applyShow']);
       $router->get('/detail',[StudentController::class,'detail']);
       $router->post('/apply',[StudentController::class,'apply']);
       $router->post('/result',[StudentController::class,'result']);
    });

    $router->group(['prefix'=>'teacher'],function () use ($router){
       $router->get('/lst',[TeacherController::class,'lst']);
    });

    $router->group(['prefix'=>'school'],function () use ($router){
       $router->get('/detail',[SchoolController::class,'detail']);
       $router->get('/getSchoolGuanggao',[SchoolController::class,'getSchoolAdvert']);
       $router->get('/getSchoolArticle',[SchoolController::class,'getSchoolArticle']);
    });
});

Route::group(['prefix'=>'wap','middlware'=>'checkapi'],function (Router $router){

});
